package com.iot.gateway.tsl.qo;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Map;

/**
 * 设备属性请求 QO
 * 用于接收前端新增/更新设备属性的参数，包含固定字段和动态扩展字段
 *
 * @author guoxinyu
 * @create 2025/5/27 17:00
 */
@Data
@Schema(name = "PropertyQo", description = "设备属性请求 QO，包含固定字段和动态扩展字段")
public class PropertyQo {

    @Schema(description = "属性唯一标识符，更新时必填，新增可不填", example = "550e8400-e29b-41d4-a716-446655440000")
    private String id;

    @Schema(description = "属性名称", required = true, example = "temperature")
    private String name;

    @Schema(description = "数据类型，如 int、float、text、bool",  example = "float")
    private String propertyType;

    @Schema(description = "读写权限：r（只读）、rw（读写）", example = "rw")
    private String readWrite;

    @Schema(description = "单位，例如 C、% 等", example = "C")
    private String unit;

    @Schema(description = "默认值", example = "25.0")
    private Object defaultValue;

    @Schema(description = "自定义扩展字段，任意键值对，Map 格式",
            example = "{\"threshold\":30,\"alarm\":true}")
    private Map<String, Object> customFields;
}
